<%@ page contentType="text/html;charset=UTF-8" %>
    <%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
<meta name="decorator" content="common" />
	<style type="text/css">
	.shadow{
		background: #DDDDDD;
	}
	</style>
	<script src="${ctxWebStatic }/js/checkFunc.js"></script> 
	<script type="text/javascript">
	$(function(){
		var payMoney = parseFloat($('.pay_money').text());
		var freeCredit = parseFloat($('.free_credit').text());
		if(freeCredit<payMoney){
			$('#moneyNotEnough').show();
			$('#confirmPay').addClass('shadow');
		}
		$('#confirmPay').click(function(){
			if(!$(this).hasClass('shadow')){
				$('#paymentDiv').show();
			}
		})
		$('#confirmPayBtn').click(function(){
			var pwd = $('#loginPwd').val();
			if(checkFunc(pwd,'checkPwd')){
				$.ajax({
					url:'${ctxWeb}/payment/checkPwd',
					data:{'oldPassword':pwd},
					async:false,
					success:function(result){
						if(result){
							$('#vipConfirmPaymentForm').submit();
							$('#paymentDiv').hide();
						}else{
							$('#checkShowBoxSpan').text('密码错误，请重新输入');
							$('#checkShowBox').show();
						}
					}
				})
			}
		})
		$('#cancel').click(function(){
			$('#paymentDiv').hide();
		})
	})
	</script>
</head>
<body>
<div class="four_line"></div>
	<!--4line结束-->
	<!--主题内容-->
	<div class="parts_main_box bgf5">
		<div class="container">
			<div class="row">
				<!-- pc 订单管理 -->
				<div class="Credit_box clearfix">
					
					<!-- 右边部分 -->
					<div class=" pad20 pad_10">
						<div class="Credit_right">
							<!--我的地址-->
							<div class="goods_detail_info_box mar_16 clearfix">
								<h3>
									<span>支付</span>
								</h3>
								<!--正常支付-->
								<div class="pay_style_box">
									<h5>
										<span>订单编号：${order.code }</span>
										<c:if test="${credit.status==1 }">
											<a href="javascript:void(0)" class="pay_mush" id="confirmPay">付款</a>
										</c:if>
										<c:if test="${credit.status==0 }">
											<a href="javascript:void(0)" class="pay_mush shadow" id="confirmPay">付款</a>
										</c:if>
									</h5>
									<figure class="pay_style_info">
										<p>
											支付方式：
											<span>信用额度</span>
										</p>
										<p>
											支付金额：
											<span class="pay_cope">¥<span class="pay_cope pay_money">${order.payMoney }</span></span>
										</p>
										<c:if test="${credit.status==1 }">
											<p>
												可用额度：
												<span>¥<span class="free_credit">${credit.money+credit.rechargeMoney-credit.useMoney }</span>
												<span id="moneyNotEnough" style="color: #D3001E;display:none">&nbsp;&nbsp;&nbsp;额度不足&nbsp;&nbsp;<a href="${ctxWeb }/home/myCredit" style="color: #D3001E">去还款</a></span></span>
											</p>
										</c:if>
										<c:if test="${credit.status==0 }">
										<p>
											<span style="color:#D3001E">额度已被冻结，无法进行支付！请联系客服热线 400-XXX-XXXX</span></span>
										</p>
										</c:if>
									</figure>
								</div>
								<!--正常支付结束-->
							</div>	
							<!--我的地址结束-->
						</div>
					</div>
					<!-- 右边部分 end-->
				</div>
				<!-- pc 订单管理 end -->
			</div>
		</div>
	</div>
	<!--主题内容-->
	<!--确认支付弹框-->
	<div class="jd_tk" id="paymentDiv"  style="display: none;">
	    <div class="delet_box confirm_pay_box">
	        <div class="form-group clearfix">
			    <label  class="col-md-3 control-label">请输入登录密码</label>
			    <div class="col-md-8">
			      <input type="password" class="form-control" id="loginPwd"  placeholder="请输入登录密码">
			    </div>
			</div>
	        <div class="jd_btn clearfix">
	            <a href="javascript:void(0)" class="cancle" id="cancel">取消</a>
	            <a href="javascript:void(0)" class="submit" id="confirmPayBtn" style="float:left">确认支付</a>
	        </div>
	    </div>
	</div>
	<!--确认支付弹框结束-->
	<form action="${ctxWeb}/payment/vipConfirmPayment" id="vipConfirmPaymentForm" method="post">
		<!-- 订单   -->
		<input name="orderCode" value="${order.code }" type="hidden">
	</form>
</body>
</html>